package com.huwc.controller;


import com.huwc.bean.User;
import com.huwc.mapper.UserMapper;
import com.huwc.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author huwenchao
 * @since 2019-01-12
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService userService ;

    @RequestMapping("/all")
    public List<User> findAll(){
        List<User> users =  userService.selectALlMaster() ;
        users.addAll(userService.selectALlSlave());
        return users ;
    }

}

